package com.thunder.h

import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.Toast
import androidx.fragment.app.Fragment
import androidx.navigation.fragment.findNavController
import com.thunder.kocho.circle.CircleBeltView
import com.thunder.kocho.circle.CircleCPView
import com.thunder.kocho.circle.RectBeltView
import com.thunder.kocho.transition.ShrinkButton
import java.util.*

class CircleFragment:Fragment() {

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return inflater.inflate(R.layout.fragment_circle, container, false)
    }

    private lateinit var btnNext:Button
    private lateinit var btnBack:Button
    private lateinit var rectBeltView:RectBeltView
    private lateinit var circleBeltView:CircleBeltView
    private lateinit var circleCPView: CircleCPView

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        btnNext=view.findViewById(R.id.btnNext)
        btnBack=view.findViewById(R.id.btnBack)
        rectBeltView=view.findViewById(R.id.rectBeltView)
        circleBeltView=view.findViewById(R.id.circleBeltView)
        circleCPView=view.findViewById(R.id.circleCPView)

        btnNext.setOnClickListener {
            findNavController().navigate(R.id.shrinkFragment)
        }
        btnBack.setOnClickListener{
            findNavController().navigate(R.id.lokiFragment)
        }

        rectBeltView.postDelayAnimation(3000)
        circleBeltView.postDelayAnimation(3000)
        circleCPView.postDelayAnimation(1000)

    }
}